﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class groups_demoPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //得到参数
            try
            {
                string paramid = Request.QueryString["tid"].ToString();
                if (!paramid.Equals(""))
                {
                    Wozuji.Logic.groups gp = new Wozuji.Logic.groups();
                    Wozuji.Model.Team_t tm = new Wozuji.Model.Team_t();
                    int tid = Convert.ToInt32(paramid.Substring(0, paramid.IndexOf('t')));
                    tm = gp.getTeamById(tid);
                    if (tm != null)
                    {
                        teamName.Text = tm.Team_Name.ToString();
                        teamLogo.ImageUrl = tm.Team_Logo.ToString();
                        Name.Text = tm.Team_Name.ToString();
                        teamDesc.Text = tm.Team_description.ToString();
                        //写入cookie 为于用户注册后，或者登陆后加入族群信息
                        gp.setInviteGroupId(tm.Team_id.ToString());

                    }
                    else
                    {
                        Wozuji.Common.MessageBox.ShowAndRedirect(Page, "无效邀请!", "/u/userregister.aspx");
                    }
                }
            }
            catch (Exception ex)
            {
                Wozuji.Common.MessageBox.ShowAndRedirect(Page, "无效邀请!", "/u/userregister.aspx");
            }


        }
        else
        { 
        
        }
    }
}
